package leetcode7;

public class test21 {
    /*
    * 206. 反转链表*/
    public ListNode reverseList(ListNode head) {
        ListNode cur = head,pre = null;
        while(cur != null){
            ListNode temp = cur.next;
            cur.next = pre;
            pre = cur;
            cur = temp;
        }
        return pre;
    }

}
